﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YiDa.Domain;

namespace SYMetro.Domain.Modal.Membership
{
    public class User : AggregateRoot
    {
        public User()
        {
            InRoles = new List<Role>();
        }

        public string Password { get; set; }

        public int PasswordFormat {get;set;}

        public string PasswordSalt { get; set; }

        public string MobilePIN { get; set; }

        public string Email { get; set; }

        public string LoweredEmail { get; set; }

        public string PasswordQuestion { get; set; }

        public string PasswordAnswer { get; set; }

        public bool IsApproved { get; set; }

        public bool IsLockedOut { get; set; }

        public DateTime CreateDate { get; set; }

        public Nullable<DateTime> LastLoginDate { get; set; }

        public Nullable<DateTime> LastPasswordChangedDate { get; set; }

        public Nullable<DateTime> LastLockoutDate { get; set; }

        public int FailedPasswordAttemptCount { get; set; }

        public Nullable<DateTime> FailedPasswordAttemptWindowStart { get; set; }

        public int FailedPasswordAnswerAttemptCount { get; set; }

        public Nullable<DateTime> FailedPasswordAnswerAttemptWindowStart { get; set; }

        public string Comment { get; set; }

        public string UserName { get; set; }

        public string LoweredUserName { get; set; }

        public string MobileAlias { get; set; }

        public bool IsAnonymous { get; set; }

        public Nullable<DateTime> LastActivityDate { get; set; }               

        /// <summary>
        /// 显示名
        /// </summary>
        public string DisplayName { get; set; }

        /// <summary>
        /// 只能获取到用户所在的直接角色,父角色等不包含在内
        /// </summary>
        public virtual List<Role> InRoles { get; set; }
    }
}
